import Vue from 'vue'
import VueRouter from 'vue-router'
const login = () => import(/* webpackChunkName: "group-login-register" */ '../components/login.vue')
const register = () => import(/* webpackChunkName: "group-login-register" */ '../components/register.vue')
const Home = () => import(/* webpackChunkName: "group-home-welcome" */ '../views/Home.vue')
const community = () => import(/* webpackChunkName: "group-community" */ '../components/communityBox/community.vue')
const communityPost = () => import(/* webpackChunkName: "group-community" */ '../components/communityBox/communityPost.vue')
const communityPostRead = () => import(/* webpackChunkName: "group-community" */ '../components/communityBox/communityPostRead.vue')
const files = () => import(/* webpackChunkName: "group-files" */ '../components/files.vue')
const scale = () => import(/* webpackChunkName: "group-files" */ '../components/AdvanceKnowledge/scale.vue')
const interval = () => import(/* webpackChunkName: "group-files" */ '../components/BasicKnowledge/chord.vue')
const tempo = () => import(/* webpackChunkName: "group-files" */ '../components/BasicKnowledge/tempo.vue')
const score = () => import(/* webpackChunkName: "group-files" */ '../components/BasicKnowledge/score.vue')
const chord = () => import(/* webpackChunkName: "group-files" */ '../components/BasicKnowledge/chord.vue')
const a = () => import(/* webpackChunkName: "group-files" */ '../components/a.vue')
const c = () => import(/* webpackChunkName: "group-files" */ '../components/c.vue')
const welcome = () => import(/* webpackChunkName: "group-home-welcome" */ '../components/welcome.vue')
const user = () => import(/* webpackChunkName: "group-user" */ '../components/user.vue')
Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/Home' },
  {
    path: '/Home',
    component: Home,
    children: [{
      path: '/Files',
      component: files,
      children: [
        { path: '/Scale', component: scale },
        { path: '/Chord', component: chord },
        { path: '/Interval', component: interval },
        { path: '/Tempo', component: tempo },
        { path: '/Score', component: score },
        { path: '/a', component: a },
        { path: '/c', component: c },
        { path: '/welcome', component: welcome }
      ]
    },
    {
      path: '/Community',
      component: community,
      redirect: '/CommunityPost',
      children: [
        { path: '/CommunityPost', component: communityPost },
        { path: '/CommunityPostRead', component: communityPostRead }
      ]
    },
    { path: '/User', component: user }]
  },
  { path: '/Login', component: login },
  { path: '/Register', component: register }

]

const router = new VueRouter({
  routes
})

export default router
